package com.wnxy.admin.mapper;
import com.wnxy.admin.dto.JChargingPileDto;
import com.wnxy.admin.dto.JChargingStationDto;
import com.wnxy.admin.dto.ChargingPileDto;
import com.wnxy.admin.dto.ReservationChargingPileDto;
import org.apache.ibatis.annotations.Mapper;
import com.wnxy.admin.entity.ChargingPile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 充电桩 Mapper 接口
 * </p>
 *
 * @author All
 * @since 2023-11-29
 */
@Mapper
public interface ChargingPileMapper extends BaseMapper<ChargingPile> {
    /**
     * @note 作者：lqc
     * @note 查询电桩信息方法
     * */

    List<JChargingPileDto> findAll(String chargingPileName);

    int updateById(JChargingPileDto jChargingPileDto);

    @Select("SELECT p.id,p.charging_pile_number chargingPileNumber,p.charging_pile_name chargingPileName,p.charging_pile_sort chargingPileSort,p.charging_pile_type chargingPileType,p.charging_gun_amount chargingGunAmount,p.charging_power chargingPower,p.charging_pile_state chargingPileState,p.charging_pile_detail chargingPileDetail,p.maintenance_state maintenanceState,p.charging_pile_photo chargingPilePhoto,p.charging_station_id chargingStationId,charging_station_name chargingStationName,charging_station_place chargingStationPlace FROM t_charging_pile p LEFT JOIN t_charging_station s ON p.charging_station_id = s.id")
    List<JChargingPileDto> listDto();

    List<ReservationChargingPileDto> selectAllFromReservation();
}
